package com.atguigu.flink.chapter05.transform.partition;


import org.apache.flink.api.common.functions.Partitioner;

import java.util.Random;

/*
Partitioner<String>中的String是被分区的key的类型
 */
public class MyPartitioner implements Partitioner<String> {
    @Override
    public int partition(String s, int i) {
        return new Random().nextInt(i);
    }
}
